<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\BaseController;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class SystemController extends BaseController
{

    /**
     * 获取问题
     */
    public function getQuestion()
    {
          $data=DB::table('query')->select('id','question','answer')->get();
          return $this->success($data);
    }

    /**
     * 关于我们
     */
    public function getAbout()
    {
        return $this->success(DB::table('about')->first());
    }

    /**
     * 获取条款
     */
    public function getClause()
    {
        return $this->success();
    }

        /**
     * 用户协议
     * @return \Illuminate\Http\JsonResponse
     */
    public function agreement()
    {
       $agreement= DB::table('config')->value('agreement');
       $privacy='隱私！！';
        return $this->success(compact('agreement','privacy'));
    }

    public function getMoney()
    {

        return $this->success(DB::table('config')->select('min_money','max_money')->first());
    }
}
